/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package bs.stock.modelo;

import bs.global.modelo.Auditoria;
import bs.global.modelo.CodigoPostal;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 *
 * @author Claudio
 */
@Entity
@Table(name = "st_deposito")
public class Deposito implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "CODIGO", nullable = false, length = 15)
    private String codigo;
    @Basic(optional = false)
    @Column(name = "DESCRP", nullable = false, length = 60)
    private String descripcion;
    @Basic(optional = false)
    @Column(name = "DIRECC", nullable = false, length = 60)
    private String direccion;
    
    //Codigo postal
    @JoinColumn(name = "CODPOS", referencedColumnName = "ID", nullable = false)    
    @ManyToOne(fetch = FetchType.LAZY)
    private CodigoPostal codigoPostal;
    
    @Basic(optional = false)
    @Column(name = "TIPDEP", nullable = false, length = 1)
    private String tipoDeposito;
    @Basic(optional = false)
    @Column(name = "SIGNOS", nullable = false, length = 1)
    private String signo;
    @Basic(optional = false)
    @Column(name = "DEPFIS", nullable = false, length = 1)
    private String esDepositoFiscal;

    @Embedded
    private Auditoria auditoria;


    public Deposito(){
        
    }

    public String getCodigo() {
        return codigo;
    }

    public void setCodigo(String codigo) {
        this.codigo = codigo;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public String getDireccion() {
        return direccion;
    }

    public void setDireccion(String direccion) {
        this.direccion = direccion;
    }

    public CodigoPostal getCodigoPostal() {
        return codigoPostal;
    }

    public void setCodigoPostal(CodigoPostal codigoPostal) {
        this.codigoPostal = codigoPostal;
    }

    public String getTipoDeposito() {
        return tipoDeposito;
    }

    public void setTipoDeposito(String tipoDeposito) {
        this.tipoDeposito = tipoDeposito;
    }

    public String getSigno() {
        return signo;
    }

    public void setSigno(String signo) {
        this.signo = signo;
    }

    public String getEsDepositoFiscal() {
        return esDepositoFiscal;
    }

    public void setEsDepositoFiscal(String esDepositoFiscal) {
        this.esDepositoFiscal = esDepositoFiscal;
    }

    public Auditoria getAuditoria() {
        return auditoria;
    }

    public void setAuditoria(Auditoria auditoria) {
        this.auditoria = auditoria;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 97 * hash + (this.codigo != null ? this.codigo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Deposito other = (Deposito) obj;
        if ((this.codigo == null) ? (other.codigo != null) : !this.codigo.equals(other.codigo)) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Deposito{" + "codigo=" + codigo + '}';
    }
    
}
